using Microsoft.AspNetCore.Mvc;
using ShopForWeb.Dto.ViewModels;
using ShopForWeb.UI.Extensions;
using ShopForWeb.UI.Filters;

namespace ShopForWeb.UI.Controllers;


[Route("error")]

public class ErrorController : Controller
{
  [UserInfoFiler]
  public IActionResult Index()
  {
    var exception = this.HttpContext.Session.Get<ExceptionViewModel>("exception");
    this.HttpContext.Session.Remove("exception");
    ViewBag.Data = exception;
    return View();
  }
}
